package DbUtil;

import java.sql.Connection;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class JdbcUtils {
	
	private static DataSource dataSource=null;
	
	static {
		dataSource=new ComboPooledDataSource("lateapp");
	}
	
	public static void releaseConnection(Connection conn) {
		
		try {
			if(conn!=null) {
				conn.close();
			}
		}catch(Exception e) {
			e.printStackTrace();
		}
	}
	public static Connection getConnection() throws Exception{
		
		return dataSource.getConnection();
	}
}
